package com.ep.commonbaseadapter.multi;

import com.ep.commonbaseadapter.R;
import com.ep.commonbaseadapter.base.ItemViewDelegate;
import com.ep.commonbaseadapter.base.ViewHolder;
import com.ep.commonbaseadapter.bean.ChatMessage;

/**
 * Created by Administrator on 2017/7/31.
 */

public class LeftItemViewDelegate implements ItemViewDelegate<ChatMessage>  {
    @Override
    public int getItemViewLayoutId() {
        return R.layout.adapter_multi_left_item;
    }

    @Override
    public boolean isForViewType(ChatMessage data, int postiton) {
        return data.isComMeg();
    }

    @Override
    public void bindData(ViewHolder viewHolder, ChatMessage data, int position) {
        viewHolder.setText(R.id.chat_from_content, data.getContent());
        viewHolder.setText(R.id.chat_from_name, data.getName());
        viewHolder.setImageResource(R.id.chat_from_icon, data.getIcon());

    }
}
